<?php
('Access-Control-Allow-Origin：*');
include("../config/mysql.php");
$id = $_POST["id"];
$db = new mysql();
$student = $db->getResultNum("SELECT id FROM students WHERE cengci = {$id}");
$educational = $db->getResultNum("SELECT id FROM educational WHERE level = {$id}");
if ($student > 0 || $educational > 0) {
    echo "CANNOT DELETE";
} else {
    $sql = "DELETE FROM cengci WHERE id = {$id}";
    echo $db->Query($sql);
}
$db->close();
